home *** CD-ROM | disk | FTP | other *** search
/ PC Guide Interactive 5 / PC Guide Issue 5 (Future Publishing) (1995).iso / win95 / shared.dir / 00382_Script_DIALOG CALLING SCRIPTS < prev    next >
Text File  |  1995-06-01  |  14KB  |  541 lines

  1. --== DIALOGS
  2. -- The actual dialogs and scripts are in the dialog movie, which is opened as a MIAW.
  3. -- The dialog scripts open the dialog movie and exit.  Both movies are in process.
  4.  
  5. --  When a button is presses, the dialog movie puts the selected button's text (cancel, exit, etx.) into "the result" and calls the calling handler.
  6.  
  7. on dialogOpen d
  8.   global gDialogWindow, gLastAudio
  9.   
  10.   set gLastAudio = ""  -- try to make audio play again
  11.   sound stop 1
  12.   
  13.   --  DIALOG FRAME   DESCRIPTION
  14.   -- d1         Exit
  15.   -- d2         Reseller T.O.
  16.   -- d3         end auto demo
  17.   -- d4         restart
  18.   -- d5         restart from autodemo
  19.   
  20.   if objectP(gDialogWindow) then
  21.     forget gDialogWindow
  22.   end if
  23.   
  24.   set gDialogWindow to window "dw"
  25.   set the fileName of gDialogWindow to "Mdialogs.DIR"
  26.   
  27.   set myWindowRect to rect(1,1,2,2)
  28.   set the rect of gDialogWindow to myWindowRect
  29.   set the windowType of gDialogWindow to 2
  30.   set the modal of gDialogWindow to true
  31.   set the titleVisible of gDialogWindow to false
  32.   
  33.   set the visible of gDialogWindow to false
  34.   moveToBack gDialogWindow
  35.   
  36.   --puppetSprite 48,1
  37.   --set the locH of sprite 48 to 322
  38.   --set the locV of sprite 48 to 237
  39.   --updateStage
  40.   open gDialogWindow
  41.   
  42.   tell gDialogWindow
  43.     go to frame d
  44.     put dialogWidth() into w
  45.     put dialogHeight() into ht
  46.   end tell
  47.   
  48.   
  49.   
  50.   set h to the StageLeft + 320 - (w/2)
  51.   set v to the stageTop + 240 - (ht/2) 
  52.   set myWindowRect to rect(h, v, h + w-2, v + ht-2)
  53.   set the rect of gDialogWindow to myWindowRect
  54.   
  55.   
  56.   set the visible of gDialogWindow to true
  57.   moveToFront gDialogWindow
  58.   updateStage
  59.   --alert string(the loch of sprite 48)
  60. end
  61.  
  62.  
  63. on dialogClose
  64.   global gDialogWindow
  65.   if objectP(gDialogWindow) then
  66.     set the modal of gDialogWindow to false
  67.     set the visible of gDialogWindow to false
  68.     
  69.     --set the locH of sprite 48 to -1000
  70.     puppetSprite 48,0
  71.     
  72.     forget gDialogWindow
  73.     updateStage
  74.     if the movie = "M08CHBKG.DIR" and the frameLabel = "end" then
  75.       drawPaper
  76.     end if
  77.   end if
  78. end
  79.  
  80.  
  81.  
  82. on timeOutResellerDialog
  83.   global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout
  84.   global gDialogWindow,gDialogResult,gDialogCallback,gAutoMode,gMainMovieName
  85.   
  86.   if gDialogResult = "" then
  87.     -- set up dialog
  88.     put "timeOutResellerDialog" into gDialogCallback
  89.     put "" into gDialogResult
  90.     
  91.     set gLastTimeoutScript to the timeOutScript
  92.     set gLastTimeoutLength to the timeoutLength
  93.     
  94.     set the timeOutScript to ""
  95.     set the timeoutLength to gDialogTimeout
  96.     set the timeOutScript to "goCloser"
  97.     
  98.     if gAutoMode = true then
  99.       dialogOpen "d5"
  100.     else
  101.       dialogOpen "d5a"
  102.     end if
  103.     
  104.   else
  105.     --
  106.     -- check result and take action
  107.     dialogClose
  108.     set r = gDialogResult
  109.     set gDialogResult = ""
  110.     set the timeOutScript to ""
  111.     set the timeoutLength to 0
  112.     
  113.     if r = "automatic" then 
  114.       -- stay in topic but in interactive mode
  115.       set gAutoMode to 1
  116.       set gTeaserMode to 0
  117.       clearTimeout
  118.       
  119.       if the movie = gMainMovieName then
  120.         clearMenuButtons
  121.         selectSection "quick tour"
  122.       end if
  123.       
  124.     else if r = "interactive" then
  125.       set gAutoMode to 0
  126.       set gTeaserMode to 0
  127.       resetResellerTimeout
  128.     else if r = "restart" then 
  129.       goCloser
  130.       exit
  131.     end if
  132.     
  133.   end if
  134. end
  135.  
  136. on exitDialog
  137.   global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout
  138.   global gDialogWindow,gDialogResult,gDialogCallback,gLastTimeoutScript,gLastTimeoutLength
  139.   global gAutoMode,gResellerVersion
  140.   global gLastScreen
  141.   
  142.   -- save place
  143.   --put the frame & "," & the movie into gLastScreen
  144.   
  145.   
  146.   if gDialogResult = "" then
  147.     -- set up dialog
  148.     put "exitDialog" into gDialogCallback
  149.     put "" into gDialogResult
  150.     
  151.     set gLastTimeoutScript to the timeOutScript
  152.     set gLastTimeoutLength to the timeoutLength
  153.     
  154.     set the timeOutScript to ""
  155.     --set the timeoutLength to gDialogTimeout
  156.     --set the timeOutScript to "goCloser"
  157.     
  158.     dialogOpen "d1"
  159.     
  160.   else
  161.     -- check result and take action
  162.     dialogClose
  163.     set r = gDialogResult
  164.     set gDialogResult = ""
  165.     set the timeOutScript to ""
  166.     set the timeoutLength to 0
  167.     
  168.     if r = "exit" then 
  169.       if gResellerVersion = FALSE then
  170.         scanDialog
  171.       else
  172.         goCloser
  173.       end if
  174.     end if
  175.     -- if cancel...
  176.     set the timeOutScript to gLastTimeoutScript
  177.     set the timeoutLength to gLastTimeoutLength
  178.   end if
  179. end
  180.  
  181.  
  182. on scanDialog
  183.   global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout,gScanExitFlag
  184.   global gDialogWindow,gDialogResult,gDialogCallback,gLastTimeoutScript,gLastTimeoutLength
  185.   
  186.   
  187.   
  188.   if gDialogResult = "" then
  189.     -- set up dialog
  190.     put "scanDialog" into gDialogCallback
  191.     put "" into gDialogResult
  192.     
  193.     set gLastTimeoutScript to the timeOutScript
  194.     set gLastTimeoutLength to the timeoutLength
  195.     
  196.     set the timeOutScript to ""
  197.     --set the timeoutLength to gDialogTimeout
  198.     --set the timeOutScript to "goCloser"
  199.     
  200.     
  201.     dialogOpen "d6"
  202.     
  203.   else
  204.     -- check result and take action
  205.     dialogClose
  206.     set r = gDialogResult
  207.     set gDialogResult = ""
  208.     set the timeOutScript to ""
  209.     set the timeoutLength to 0
  210.     
  211.     if r = "exit" then
  212.       goCloser
  213.       exit
  214.     else if r = "scan" then 
  215.       set gScanExitFlag = 3
  216.       goScan
  217.       exit
  218.     end if
  219.     
  220.     -- if cancel...
  221.     set the timeOutScript to gLastTimeoutScript
  222.     set the timeoutLength to gLastTimeoutLength
  223.   end if
  224. end
  225.  
  226.  
  227. on deleteFilesDialog
  228.   global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout
  229.   global gDialogWindow,gDialogResult,gDialogCallback,gLastTimeoutScript,gLastTimeoutLength
  230.   
  231.   if gDialogResult = "" then
  232.     -- set up dialog
  233.     put "deleteFilesDialog" into gDialogCallback
  234.     put "" into gDialogResult
  235.     
  236.     set gLastTimeoutScript to the timeOutScript
  237.     set gLastTimeoutLength to the timeoutLength
  238.     
  239.     set the timeOutScript to ""
  240.     --set the timeoutLength to gDialogTimeout
  241.     --set the timeOutScript to "goCloser"
  242.     
  243.     dialogOpen "d2"
  244.     
  245.   else
  246.     -- check result and take action
  247.     dialogClose
  248.     set r = gDialogResult
  249.     set gDialogResult = ""
  250.     set the timeOutScript to ""
  251.     set the timeoutLength to 0
  252.     
  253.     if r = "exit" then 
  254.       doQuit
  255.       exit
  256.     else if r = "delete" then 
  257.       --doDeleteFiles
  258.       deleteFilesDialog2
  259.       exit
  260.     end if
  261.     -- if cancel...
  262.     set the timeOutScript to gLastTimeoutScript
  263.     set the timeoutLength to gLastTimeoutLength
  264.   end if
  265. end
  266.  
  267. on deleteFilesDialog2
  268.   global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout
  269.   global gDialogWindow,gDialogResult,gDialogCallback,gLastTimeoutScript,gLastTimeoutLength
  270.   
  271.   if gDialogResult = "" then
  272.     -- set up dialog
  273.     put "deleteFilesDialog2" into gDialogCallback
  274.     put "" into gDialogResult
  275.     
  276.     set gLastTimeoutScript to the timeOutScript
  277.     set gLastTimeoutLength to the timeoutLength
  278.     
  279.     set the timeOutScript to ""
  280.     --set the timeoutLength to gDialogTimeout
  281.     --set the timeOutScript to "goCloser"
  282.     
  283.     dialogOpen "d7"
  284.     
  285.   else
  286.     -- check result and take action
  287.     dialogClose
  288.     set r = gDialogResult
  289.     set gDialogResult = ""
  290.     set the timeOutScript to ""
  291.     set the timeoutLength to 5
  292.     
  293.     if r = "exit" then 
  294.       doQuit
  295.       exit
  296.     end if
  297.     -- if cancel...
  298.     set the timeOutScript to gLastTimeoutScript
  299.     set the timeoutLength to gLastTimeoutLength
  300.     deleteFilesDialog
  301.   end if
  302. end
  303.  
  304.  
  305. on restartDialog
  306.   global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout
  307.   global gDialogWindow,gDialogResult,gDialogCallback,gLastTimeoutScript,gLastTimeoutLength
  308.   global gResellerVersion
  309.   
  310.   timeOutResellerDialog
  311.   exit
  312.   
  313.   
  314.   if gDialogResult = "" then
  315.     if gResellerVersion = TRUE then
  316.       timeOutResellerDialog
  317.       exit
  318.     end if
  319.     
  320.     -- set up dialog
  321.     put "restartDialog" into gDialogCallback
  322.     put "" into gDialogResult
  323.     
  324.     set gLastTimeoutScript to the timeOutScript
  325.     set gLastTimeoutLength to the timeoutLength
  326.     
  327.     set the timeOutScript to ""
  328.     set the timeoutLength to gDialogTimeout
  329.     set the timeOutScript to "goCloser"
  330.     
  331.     
  332.     dialogOpen "d4"
  333.     
  334.   else
  335.     -- check result and take action
  336.     dialogClose
  337.     set r = gDialogResult
  338.     set gDialogResult = ""
  339.     set the timeOutScript to ""
  340.     set the timeoutLength to 0
  341.     
  342.     if r = "exit" then 
  343.       goCloser
  344.       exit
  345.     else if r = "restart" then 
  346.       goRestart
  347.       exit
  348.     end if
  349.     -- if cancel...
  350.     set the timeOutScript to gLastTimeoutScript
  351.     set the timeoutLength to gLastTimeoutLength
  352.   end if
  353. end
  354.  
  355. on AutoDecisionDialog
  356.   global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout
  357.   global gDialogWindow,gDialogResult,gDialogCallback,gLastTimeoutScript,gLastTimeoutLength
  358.   global gResellerVersion,gMainMovieName
  359.   global gAutoMode, gTeaserMode
  360.   
  361.   if gDialogResult = "" then
  362.     -- set up dialog
  363.     put "AutoDecisionDialog" into gDialogCallback
  364.     put "" into gDialogResult
  365.     
  366.     set gLastTimeoutScript to the timeOutScript
  367.     set gLastTimeoutLength to the timeoutLength
  368.     
  369.     set the timeOutScript to ""
  370.     
  371.     if gResellerVersion = TRUE then
  372.       set the timeoutLength to gDialogTimeOut
  373.       set the timeOutScript to "chooseTeaserDemo"
  374.     end if
  375.     
  376.     dialogOpen "d5"
  377.     
  378.   else
  379.     -- check result and take action
  380.     dialogClose
  381.     set r = gDialogResult
  382.     set gDialogResult = ""
  383.     
  384.     if r = "interactive" then 
  385.       -- stay in topic but in interactive mode
  386.       set gAutoMode to 0
  387.       set gTeaserMode to 0
  388.       
  389.       if gResellerVersion = TRUE then
  390.         resetResellerTimeout
  391.       else
  392.         set the timeOutScript to gLastTimeoutScript
  393.         set the timeoutLength to gLastTimeoutLength
  394.       end if
  395.       exit
  396.     else if r = "restart" then 
  397.       goRestart
  398.       exit
  399.     else
  400.       -- if cancel...
  401.       set the timeOutScript to gLastTimeoutScript
  402.       set the timeoutLength to gLastTimeoutLength
  403.       
  404.     end if
  405.   end if
  406. end
  407.  
  408.  
  409. on timeOutDialog
  410.   global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout
  411.   global gDialogWindow,gDialogResult,gDialogCallback,gLastTimeoutScript,gLastTimeoutLength
  412.   
  413.   if gDialogResult = "" then
  414.     -- set up dialog
  415.     put "timeOutDialog" into gDialogCallback
  416.     put "" into gDialogResult
  417.     
  418.     set gLastTimeoutScript to the timeOutScript
  419.     set gLastTimeoutLength to the timeoutLength
  420.     
  421.     set the timeOutScript to ""
  422.     set the timeoutLength to gDialogTimeout
  423.     set the timeOutScript to "goCloser"
  424.     
  425.     
  426.     dialogOpen "d5"
  427.     
  428.   else
  429.     -- check result and take action
  430.     dialogClose
  431.     set r = gDialogResult
  432.     set gDialogResult = ""
  433.     set the timeOutScript to ""
  434.     set the timeoutLength to 0
  435.     
  436.     if r = "exit" then 
  437.       goCloser
  438.       exit
  439.     else if r = "restart" then 
  440.       goRestart
  441.       exit
  442.     end if
  443.     
  444.     -- if cancel...
  445.     set the timeOutScript to gLastTimeoutScript
  446.     set the timeoutLength to gLastTimeoutLength
  447.   end if
  448. end
  449.  
  450. on endAutoDemoDialog
  451.   global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout
  452.   global gDialogWindow,gDialogResult,gDialogCallback,gLastTimeoutScript,gLastTimeoutLength
  453.   global gResellerVersion
  454.   
  455.   if gDialogResult = "" then
  456.     -- set up dialog
  457.     put "endAutoDemoDialog" into gDialogCallback
  458.     put "" into gDialogResult
  459.     
  460.     set gLastTimeoutScript to the timeOutScript
  461.     set gLastTimeoutLength to the timeoutLength
  462.     
  463.     set the timeOutScript to ""
  464.     if gResellerVersion = true then
  465.       set the timeoutLength to gDialogTimeout
  466.       set the timeOutScript to "goCloser"
  467.     end if
  468.     
  469.     dialogOpen "d3"
  470.     
  471.   else
  472.     -- check result and take action
  473.     dialogClose
  474.     set r = gDialogResult
  475.     set gDialogResult = ""
  476.     set the timeOutScript to ""
  477.     set the timeoutLength to 0
  478.     
  479.     if r = "exit" then 
  480.       exitDialog
  481.       exit
  482.     else if r = "restart" then 
  483.       goRestart
  484.       exit
  485.     end if
  486.     
  487.     -- if cancel...
  488.     set the timeOutScript to gLastTimeoutScript
  489.     set the timeoutLength to gLastTimeoutLength
  490.   end if
  491. end
  492.  
  493.  
  494.  
  495. on endAutoDemoDialogReseller
  496.   global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout
  497.   global gDialogWindow,gDialogResult,gDialogCallback,gLastTimeoutScript,gLastTimeoutLength
  498.   global gResellerVersion
  499.   
  500.   if gDialogResult = "" then
  501.     -- set up dialog
  502.     put "endAutoDemoDialogReseller" into gDialogCallback
  503.     put "" into gDialogResult
  504.     
  505.     set gLastTimeoutScript to the timeOutScript
  506.     set gLastTimeoutLength to the timeoutLength
  507.     
  508.     set the timeOutScript to ""
  509.     if gResellerVersion = true then
  510.       set the timeoutLength to gDialogTimeout
  511.       set the timeOutScript to "goCloser"
  512.     end if
  513.     
  514.     dialogOpen "d9"
  515.     
  516.   else
  517.     -- check result and take action
  518.     dialogClose
  519.     set r = gDialogResult
  520.     set gDialogResult = ""
  521.     set the timeOutScript to ""
  522.     set the timeoutLength to 0
  523.     
  524.     if r = "menu" then 
  525.       set gAutoMode to 0
  526.       set gTeaserMode to 0
  527.       resetResellerTimeout
  528.       goMenu
  529.       exit
  530.     else if r = "restart" then 
  531.       goRestart
  532.       exit
  533.     end if
  534.     
  535.     -- if cancel...
  536.     set the timeOutScript to gLastTimeoutScript
  537.     set the timeoutLength to gLastTimeoutLength
  538.   end if
  539. end
  540.  
  541.